<template>
    <div class="sale-retriction-suppliers">
        <search-form :searchArray="searchArray">
            <el-button type="primary" class="search btn mL20" @click="showAddDialog.show = true">添加</el-button>
        </search-form>
        <elTable :formData="formData" @tableData="getList" ref="dataInfo">
                <el-table-column prop="group" label="供应商全称" align="center"></el-table-column>
                <el-table-column prop="group" label="供应商简称" align="center"></el-table-column>
                <el-table-column prop="loginTime" label="供应商编号" align="center"></el-table-column>
                <el-table-column prop="loginTime" label="最低配送金额" align="center"></el-table-column>
                <el-table-column prop="loginTime" label="是否启用" align="center"></el-table-column>
                <el-table-column prop="action" label="操作" align="center" width="200px">
                    <template slot-scope="scope">
                        <el-button type="text"  @click="editer(scope.row)">修改</el-button>
                        <el-button type="text"  @click="manage(scope.row)">限销管理</el-button>
                    </template>
                </el-table-column>
        </elTable>
        <dialogs 
        :visible="showAddDialog"
        title="添加"
        class="supplierAdd"
        confirmText="保存"
        >
            <el-form v-model="form" label-width="100px">
                <el-form-item label="供应商全称">
                    <el-input placeholder="请输入供应商全称"></el-input>
                </el-form-item>
                <el-form-item label="供应商简称">
                    <el-input placeholder="请输入供应商简称"></el-input>
                </el-form-item>
                <el-form-item label="最低配送额">
                    <el-input placeholder="请输入最低配送额"></el-input>
                </el-form-item>
                <el-form-item label="手机号">
                    <el-input placeholder="请输入手机号"></el-input>
                </el-form-item>
                <el-form-item label="是否启用">
                    <el-select v-model="form.a">
                        <el-option value=""></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="备注">
                    <textarea name="" id="" cols="30" rows="10"></textarea>
                </el-form-item>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="公司LOGO">
                            <elUpload></elUpload>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="公司长LOGO">
                            <elUpload></elUpload>
                        </el-form-item> 
                    </el-col>
                </el-row>
            </el-form>
        </dialogs>
    </div>
</template>
<script>
import elTable from "@/components/xForm/elTable"
import elUpload from '@/components/xForm/elUpload';
export default {
    name: 'saleRestrictionSuppliers',
    components: {
        elTable,
        elUpload
    },
    data () {
        return {
            searchArray: [
                {
                    type: "input",
                    placeholder: "请输入供应商全称",
                    types: "text",
                    value: "",
                    label: "供应商全称"
                },
                {
                    type: "select",
                    placeholder: "请选择",
                    value: "",
                    label: "是否启用",
                    list: []
                }
            ],
            formData: {
                currentPage: 1,
                pageSize: 10,
            },
            form: {
                a: ''
            },
            showAddDialog: {
                show: false
            }
        }
    },
    methods: {
        getList(pageNo) {
            let dataInfo = [
                {
                    id: 1,
                    name: "你好",
                    createTime: '1595244696000'
                },
                {
                    id: 2,
                    name: "你好1",
                    createTime: '1595244696000'
                },
            ];
            let total = 10;
            this.$nextTick(() => {
                this.$refs.dataInfo.loadData(dataInfo, total);
            })
        },
        editer () {
            this.showAddDialog.show = true
        },
        manage () {
            this.$router.push({
                path: '/goods/saleRestrictionSuppliers/detail'
            })
        }
    }
}
</script>
<style lang="scss" scoped>
.sale-retriction-suppliers {
    .search-form {
        margin-bottom: 16px;
    }
}
::v-deep.supplierAdd {
    textarea {
        width: 100%;
        border-color: #ddd;
        padding: 10px;
        height: 100px;
        &:focus {
            outline: none;
        }
    }
    .el-select {
        width: 100%;
    }
}
</style>